package com.hcz.elastic.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author hcz
 * @describtion TODO
 * @date 2019-06-15 12:15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "goods",type = "goods",shards = 3,replicas = 1)
public class Goods {

    @Id
    private Long id;

    /**
     * 标题
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String title;

    /**
     * 分类
     */
    @Field(type = FieldType.Keyword)
    private String category;

    /**
     *    品牌
     */
    @Field(type = FieldType.Keyword)
    private String brand;

    /**
     *  价格
     */
    @Field(type = FieldType.Double)
    private Double price;

    /**
     * 图片地址
     */
    @Field(type = FieldType.Keyword,index = false)
    private String images;
}
